local extension = Package("fkpve")
Fk:loadTranslationTable{
    ["fkpve"] = "PVE",
    ["l"] = "浪"
}
local GensLimts=require "packages/fkpve/GensLimts"
--幻想风车
local hxfc_author = General(extension, "hxfc_author", "wei", 1)
Fk:loadTranslationTable{
  ["hxfc_author"] = "幻想风车",
}


local l__defendcity = General(extension,"l__defendcity","qun",50)
local l_gucheng = fk.CreateTriggerSkill{
  name = "l_gucheng",
  -- anim_type = "",
  frequency = Skill.Compulsory,
  events = {fk.GameStart,fk.TurnStart,fk.TurnEnd},
  can_trigger = function (self, event, target, player, data) 
    if not player:hasSkill(self.name) then return end
    if event ==fk.GameStart or event ==fk.TurnStart then
      return player.general == target.general
    end
    return event ==fk.TurnEnd 
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if event ==fk.GameStart then
      room:setPlayerMark(player,"@gc_chengfang",4)
      room:changeShield(player,4)
    elseif event ==fk.TurnStart then
      player:skip(Player.Start)
      player:skip(Player.Judge)
      player:skip(Player.Draw)
      player:skip(Player.Play)
      player:skip(Player.Discard)
    elseif event ==fk.TurnEnd then
      player:throwAllCards("h")
      room:drawCards(player,2*player:getMark("@gc_chengfang"),self.name)
    end
  end,
}
local l_jianta = fk.CreateTriggerSkill{
  name = "l_jianta",
  -- anim_type = "",
  frequency = Skill.Compulsory,
  events = {fk.TargetConfirming},
  can_trigger = function (self, event, target, player, data)
    if data.card and data.card.trueName == "slash" and player:hasSkill(self.name) and player:usedSkillTimes(self.name,Player.HistoryRound) < 2 then
      local tar = player.room:getPlayerById(data.to)
      local from = player.room:getPlayerById(data.from)
      return from and not from.dead and from.general ~= "l__defendcity" and  GensLimts:isSameCamp(player,tar) and player:distanceTo(tar) == 1
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local tar = room:getPlayerById(data.from)
    room:useVirtualCard("slash", nil, player, tar, self.name)
  end,
}
local l_weicheng = fk.CreateTriggerSkill{
  name = "l_weicheng",
  anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.DamageCaused,fk.EnterDying},
  can_trigger = function (self, event, target, player, data)
    if event == fk.DamageCaused and player:hasSkill(self.name) and data.card then
      if player == target and data.from == player and player.hp > player.maxHp / 2 then
        return true
      end
      if data.to == player and player.hp <= player.maxHp / 2 then
        return true
      end
    end
    return event == fk.EnterDying and player:hasSkill(self.name) and player == target
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if event == fk.DamageCaused then
      data.damage = data.damage + 1
    else
      room:gameOver(player.role == "loyalist" and "rebel" or "loyalist")
    end
  end,
}
l__defendcity:addSkill(l_gucheng)
l__defendcity:addSkill(l_jianta)
l__defendcity:addSkill(l_weicheng)
Fk:loadTranslationTable{
  ["l__defendcity"] = "主城",
  ["l_gucheng"] = "固城",
  [":l_gucheng"] = "锁定技。游戏开始你获得4个“城防”标记和等量护甲，每两轮该标记-1直到为0。你跳过回合内所有阶段。每个回合结束时，你丢掉所有手牌并摸2X张牌（X为“城防标记”）。",
  ["@gc_chengfang"] = "城防",
  ["l_jianta"] = "箭塔",
  [":l_jianta"] = "锁定技。距离1的友方（若自己有“城防”标记）受到【杀】指向目标时，若伤害来源不是友方则你视为对其使用【杀】。（每轮限两次）",
  ["l_weicheng"] = "危城",
  [":l_weicheng"] = "锁定技。当你使用牌造成伤害时，若你的体力值为最大体力一半以上则造成伤害+1。若你受到其他人使用牌造成伤害时，若你的体力值为最大体力一半及以下受到伤害+1。当你进入濒死状态直接死亡游戏结束。"
}


--潘多拉宝箱
--吞噬
local l_tunshi = fk.CreateTriggerSkill{
    name = "l_tunshi",
    -- anim_type = "",
    frequency = Skill.Compulsory,
    events = {fk.CardUseFinished,fk.TargetConfirming},
    can_trigger = function (self, event, target, player, data) 
      if not player:hasSkill(self.name) then return end
      if event ==fk.TargetConfirming then
          return player.phase == Player.NotActive and data.to == player.id and data.from ~= player.id and math.random() < 0.4
      else
          return player.phase == Player.NotActive and target ~= player and data.card and math.random() < 0.4
      end
    end,
    on_use = function(self, event, target, player, data)
      local room = player.room
      if event ==fk.TargetConfirming then
        AimGroup:cancelTarget(data, data.to)
      else
        local targethands = target:getCardIds{Player.Hand, Player.Equip}
        if #targethands > 0 then
            local randc = table.random(targethands)
            room:obtainCard(player.id,randc,true,fk.ReasonJustMove)
            local card = Fk:getCardById(randc)
            if card.type == Card.TypeTrick then
                  room:damage{
                  from = player,
                  to = target,
                  damage = 1,
                  skillName = self.name,
                }
            end
            if card.type == Card.TypeBasic then
                room:changeMaxHp(player, 1)
            end
        end
      end
      
     end,
}
local obtreasure = {shenqi = 0.2,skill = 0.15,draw=0.3,none = 0.35}
local l_caibao = fk.CreateTriggerSkill{
    name = "l_caibao",
    -- anim_type = "",
    frequency = Skill.Compulsory,
    events = {fk.Damaged,fk.EventPhaseStart},
    can_trigger = function (self, event, target, player, data) 
      if player == target and player:hasSkill(self.name) then
        if event == fk.Damaged then
          return data.from 
        else
          return player.phase == Player.Start
        end
      end
    end,
    on_use = function(self, event, target, player, data)
      local room = player.room
      if event == fk.EventPhaseStart then
        local hands = player:getCardIds{ Player.Hand }
        if #hands < player.maxHp then
          room:drawCards(player,player.maxHp - #hands,self.name)
        end
        player:skip(Player.Judge)
        player:skip(Player.Draw)
        player:skip(Player.Discard)
        return
      end
      local endlPrac = room.logic.endlPrac
      if not endlPrac then room:doBroadcastNotify("ShowToast", "不是巅峰神塔模式得不到我的东西。嘿嘿~") return end
      local randChoice = function (cfg,num)
        local choices = {} 
        while #choices < num do
          local rand = math.random()
          local forward = 0
          for i, v in pairs(cfg) do
            local last = v
            if rand >= forward and rand < last + forward  then
              table.insert(choices,i)
              break
            end
            forward = forward + last
          end
        end
        return choices
      end
      local rand = randChoice(obtreasure,1)[1]
      -- local rand = "shenqi"
      if rand == "shenqi" then
        local shenqi = endlPrac:getPyGodWeapon()
        if #shenqi == 0 then room:doBroadcastNotify("ShowToast", "浦元的神器被榨干了...") return end
        local isget
        local randsq = table.random(shenqi)
        endlPrac:removePyGodWeapon("st_"..randsq)
        local name = randsq
        for _, id in ipairs(Fk:getAllCardIds()) do
          local card = Fk:getCardById(id, true)
          if card.trueName == name then
            isget = true
            room:obtainCard(data.from,id,true,fk.ReasonJustMove)
            break
          end
        end
        if isget then
          room:doBroadcastNotify("ShowToast", "潘多拉吐了一把"..Fk:translate(randsq).."。"..Fk:translate(player.general) .."获得浦元的神器")
        else
          room:doBroadcastNotify("ShowToast", "找不到浦元的神器，似乎忘了开扩展包？")
        end
      elseif rand == "draw" then
        local num = table.random({1,2,3})
        room:drawCards(data.from,num,self.name)
        room:doBroadcastNotify("ShowToast", "潘多拉不耐烦吐了"..num.."张牌给"..Fk:translate(player.general))
      elseif rand == "skill" then
        if endlPrac.getpdlskillnum >= 7 then 
          room:doBroadcastNotify("ShowToast", "贪得无厌。欸嘿嘿~")
          local losehp = math.ceil(player.hp / 3)
          room:loseHp(data.from,losehp,self.name)
          room:loseHp(player,99,self.name)
          return
        end
        if endlPrac.all_generals and #endlPrac.all_generals > 0 then
          local getRandSkills = function (rands_n,all_generals,who)
            local getskills_t = {}
            local trans_skinames = ""
            while #getskills_t < rands_n do
              local randg = table.random(all_generals)
              local skills_name = {}
              for _, ski in ipairs(randg.skills) do
                if ski.frequency < Skill.Limited then
                  table.insert(skills_name,ski.name)
                end
              end
              if #skills_name > 0 then
                local rand_skill = table.random(skills_name)
                local skilltrueName = Fk.skills[rand_skill].trueName
                local canget = table.every(who.player_skills,function (ski)
                  if ski.trueName ~= skilltrueName then
                    return true
                  end
                end)
                if canget then
                  if #trans_skinames > 0 then
                    trans_skinames = trans_skinames.. "、"
                  end
                  trans_skinames = trans_skinames..Fk:translate(rand_skill)
                  table.insert(getskills_t,rand_skill)
                end
              end
            end
            local skills = table.concat(getskills_t,"|")
            skills = string.sub(skills,1,-1)
            room:handleAddLoseSkills(who, skills, nil, false)
            room:doBroadcastNotify("ShowToast",Fk:translate(who.general).."获得技能："..trans_skinames)
          end
          getRandSkills(1,endlPrac.all_generals,data.from)
          endlPrac.getpdlskillnum = endlPrac.getpdlskillnum + 1
        else
          room:drawCards(data.from ,3,self.name)
        end
      else
        room:doBroadcastNotify("ShowToast",Fk:translate(player.general).."并没有从潘多拉拿到什么...")
      end
     end,
}
local l__panduola = General(extension,"l__panduola","qun",15)
l__panduola:addSkill(l_tunshi)
l__panduola:addSkill(l_caibao)

Fk:loadTranslationTable{
    ["l__panduola"] = "潘多拉",
    ["l_tunshi"] = "吞噬",
    [":l_tunshi"] = "锁定技，其他角色使用牌指向你时，你有概率取消之。其他角色使用牌后，你有概率随机获得对面一张牌，若获得的牌为基本牌你最大体力+1，若为锦囊牌你对其造成1点伤害",
    ["l_caibao"] = "宝藏",
    [":l_caibao"] = "锁定技，准备阶段你把手牌摸到体力上限并跳过除出牌阶段其他所有阶段，当你受到伤害时，你有概率令伤害来源获得某种东西（对巅峰神塔有效否则都为摸牌）",
}
--吕布
local l_wushuang = fk.CreateTriggerSkill{
  name = "l_wushuang",
  anim_type = "offensive",
  frequency = Skill.Compulsory,
  events = {fk.TargetSpecified},
  can_trigger = function(self, event, target, player, data)
    if not player:hasSkill(self.name) then
      return false
    end

    if event == fk.TargetSpecified then
      return target == player and table.contains({ "slash", "duel" }, data.card.trueName)
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    data.fixedResponseTimes = data.fixedResponseTimes or {}
    if data.card.trueName == "slash" then
      local jink_mark = player:getMark("l_wushuang_sha")
      if jink_mark == 0 then
        data.fixedResponseTimes["jink"] = 4 - #data.tos[1]
        room:setPlayerMark(player,"l_wushuang_sha",data.fixedResponseTimes["jink"])
      else
        data.fixedResponseTimes["jink"] = jink_mark
      end
      if #data.tos[1] == 1 and data.to == data.tos[1][1] then
        room:setPlayerMark(player,"l_wushuang_sha",0)
      end
      return
    else
        data.fixedAddTimesResponsors = data.fixedAddTimesResponsors or {}
        table.insert(data.fixedAddTimesResponsors, data.to)
        local mark = player:getMark("l_wushuang_duel")
      if mark == 0 then
        
        data.fixedResponseTimes["slash"] = 4 - #data.tos[1]
      else
        data.fixedResponseTimes["slash"] = mark
        if #data.tos[1] == 1 and data.to == data.tos[1][1] then
            room:setPlayerMark(player,"l_wushuang_duel",0)
            return
        end
      end
    end

    if data.card.trueName == "duel" and player:getMark("l_wushuang_duel") == 0 then
        local fiterother = table.filter(room:getOtherPlayers(player),function (p)
            if p.id ~= data.to then
                return true
            end
        end)
        if #fiterother == 0 then 
            room:setPlayerMark(player,"l_wushuang_duel",0)
            return 
        end
        local pids = room:askForChoosePlayers(player,table.map(fiterother,function (p)
            return p.id
        end),0,2,"#l_wushuang_invoke",self.name,true)
        
        if #pids > 0 then
            table.forEach(pids, function(pid)
                -- AimGroup:addTargets(room, data, pid)
                TargetGroup:pushTargets(data.targetGroup, pid)
                -- table.insert(data.fixedAddTimesResponsors, pid)
                table.insert(data.tos[1], pid)
            end)
            
            data.fixedResponseTimes["slash"] = data.fixedResponseTimes["slash"] - #pids
            room:setPlayerMark(player,"l_wushuang_duel",data.fixedResponseTimes["slash"])
        end
    end
  end,
}

local l_wushuang_tarmod = fk.CreateTargetModSkill{
  name = "#l_wushuang_tarmod",
  extra_target_func = function(self, player, skill)
    if skill.trueName == "slash_skill" and player:hasSkill("l_wushuang") then
      return 2
    end
  end,
}

local l_wumou = fk.CreateTriggerSkill{
  name = "l_wumou",
--   anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.AfterCardsMove,fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(self.name) then
        if event == fk.AfterCardsMove then
            for _, move in ipairs(data) do
                if move.to and move.to == player.id and move.toArea and move.toArea == Card.PlayerHand then
                    local trick_cards = {}
                    
                    for _, info in ipairs(move.moveInfo) do
                        local card = Fk:getCardById(info.cardId)
                        if card and card.type == Card.TypeTrick then
                            table.insert(trick_cards,info.cardId)
                        end
                    end
                    if #trick_cards > 0 then
                        self.cost_data = trick_cards
                        
                        return true
                    end
                end
            end
        else
            
            return target.phase == Player.Start
        end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local handcard = function (cids,name)
        table.forEach(cids,function(cid)
            local card = Fk:getCardById(cid)
            if card.type == Card.TypeTrick then
                room:setCardMark(card,"use_duel_slash",name)
                
            end
        end)
    end
    if player.phase ~= Player.NotActive then
        if event == fk.AfterCardsMove then
            if not self.cost_data then return end
            handcard(self.cost_data,"duel")
        else
            handcard(player.player_cards[Player.Hand],"duel")
        end
    else
        if event == fk.AfterCardsMove then
            if not self.cost_data then return end
            handcard(self.cost_data,"slash")
        else
            handcard(player.player_cards[Player.Hand],"slash")
        end
    end
    
    self.cost_data = nil
  end,
}

local l_wumou_duel_slash = fk.CreateFilterSkill{
  name = "#l_wumou_duel_slash",
  card_filter = function(self, card, player)
    if player:hasSkill(self.name) and card.type == Card.TypeTrick and card:getMark("use_duel_slash") ~= 0 then
        return true
    end
  end,
  view_as = function(self, card) 
    local c = Fk:cloneCard(card:getMark("use_duel_slash"), card.suit, card.number)
    c.skillName = self.name
    return c
  end,
}

local l_wuqian = fk.CreateTriggerSkill{
    name = "l_wuqian",
    anim_type = "offensive",
    events = {fk.TargetConfirming},
    can_trigger = function (self, event, target, player, data)
        return  player:hasSkill(self.name) and data.to == player.id and data.from ~= data.to and data.card and data.card.trueName == "slash"
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        return true
    end,
     on_use = function(self, event, target, player, data)
        local room = player.room
        local user = room:getPlayerById(data.from)
        local use = room:askForUseCard(player, "slash", "slash", "l_wuqian_slash::"..data.from, true, {must_targets = {data.from}, bypass_distances = true})
        if use then
            room:useCard(use)
        end
        -- room:useVirtualCard("slash", nil, player, user, self.name)
     end,
}

local l_wuqian_dist = fk.CreateDistanceSkill{
  name = "#l_wuqian_dist",
  correct_func = function(self, from, to)
    if from:hasSkill("l_wuqian") then
      return -1
    end
  end,
}

local l__lvbu = General(extension,"l__lvbu","qun",5)
l__lvbu:addSkill(l_wushuang)
l__lvbu:addSkill(l_wumou)
l__lvbu:addSkill(l_wuqian)
l_wushuang:addRelatedSkill(l_wushuang_tarmod)
l_wumou:addRelatedSkill(l_wumou_duel_slash)
l_wumou:addRelatedSkill(l_wuqian_dist)
Fk:loadTranslationTable{
    ["l__lvbu"] = "吕布",
    ["l_wushuang"] = "无双",
    [":l_wushuang"] = "锁定技，当你使用“杀” 或“决斗”指定目标后，至多指定两名其他角色为目标;你使用的“ 杀”需打出4-X张“闪”才能抵消;与你进行“决斗”的角色需连续打出4-X张“杀”( X为此牌指定的目标数)。",

    ["l_wumou"] = "无谋",
    [":l_wumou"] = "锁定技，你的锦囊牌于回合内视为“决斗”；回合外视为“杀”。",
    ["#l_wumou_duel_slash"] = "无谋",
    ["#l_wushuang_invoke"] = "请选择至多其他两名角色为决斗目标",

    ["l_wuqian"] = "无前",
    [":l_wuqian"] = "你计算与其他角色的距离-1;当你成为其他角色使用‘杀”的目标时，你可以对其使用一张“杀”。",
    ["#l_wuqian_dist"] = "无前",
    ["l_wuqian_slash"] = "是否发动无前对 %dest 出杀"
}

--吕布（修罗神话）
local l_shenwu = fk.CreateTriggerSkill{
  name = "l_shenwu",
  anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.GameStart},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(self.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    for _, id in ipairs(Fk:getAllCardIds()) do
      local card = Fk:getCardById(id)
      if card.name == "shfthj" or card.name == "shsfzjg" or card.name == "shttk" then
        if room:getCardArea(id) == Card.Void then
          room:moveCards({
            ids = {id},
            fromArea = Card.Void,
            to = player.id,
            toArea = Card.PlayerEquip,
            moveReason = fk.ReasonJustMove,
            proposer = player.id,
            skillName = self.name,
          })
          if player:getEquipment(Card.SubtypeWeapon) and player:getEquipment(Card.SubtypeTreasure) and player:getEquipment(Card.SubtypeArmor) then
              break
          end
        end
      end
    end 
  end
}

local l_shenzhan = fk.CreateTriggerSkill{
  name = "l_shenzhan",
--   anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.EventPhaseStart,fk.EventPhaseEnd},
  can_trigger = function(self, event, target, player, data)
    if event == fk.EventPhaseStart then
      return player:hasSkill(self.name) and target == player and player.phase == Player.Start
    else
      return player:hasSkill(self.name) and target == player 
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:notifySkillInvoked(player, self.name, "drawcard")
    if event == fk.EventPhaseStart then
        room:drawCards(player,#room.alive_players < 4 and 2 or 3,self.name)
    else
      room:drawCards(player,1,self.name)
    end
  end,
}

local l_shenzhan_slashmod = fk.CreateTargetModSkill{
  name = "#l_shenzhan_slashmod",
  residue_func = function(self, player, skill, scope)
    if skill.trueName == "slash_skill" and player:getMark("form_phase") > 0 then
      return player:getMark("form_phase") + 1
    end
  end,
}

local l__xiuluolvbu = General(extension,"l__xiuluolvbu","qun",20)
l__xiuluolvbu:addSkill(l_shenwu)
l__xiuluolvbu:addSkill(l_shenzhan)
l__xiuluolvbu:addSkill("l_wuqian")
l_shenzhan:addRelatedSkill(l_shenzhan_slashmod)
-- l__yuanshu:addSkill(l_rongzhu)
Fk:loadTranslationTable{
    ["l__xiuluolvbu"] = "修罗神话吕布",
    ["l_shenwu"] = "神武",
    [":l_shenwu"] = "锁定技，游戏开始把你所属得装备（神话方天画戟）（神话吞天铠）（神话束发紫金冠）  转变形态：（当体力小于9吕布转变第3形态。立刻结束当前角色回合，吕布获得一个额外得回合）",

    ["l_shenzhan"] = "神战",
    [":l_shenzhan"] = "锁定技，准备阶段开始多摸(存活角色数<4为2,否则为3)张牌，出牌阶段你可以多使用X张【杀】;一名角色回合结束时，你摸1张牌（X为形态数，初始为1）",

    ["l_shenzhi"] = "神智",
    [":l_shenzhi"] = "锁定技，濒死状态下你弃掉所有桃回复自身等量体力，若满体力，每弃置1张桃摸两张牌，你使用锦囊不可被【无懈可击】响应",
}

--吕布（虎牢关）
local l_jingjia = fk.CreateTriggerSkill{
  name = "l_jingjia",
  anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.GameStart},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(self.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    for _, id in ipairs(Fk:getAllCardIds()) do
        local card = Fk:getCardById(id)
        if card.name == "llsmd" or card.name == "wxfthj" then
            if room:getCardArea(id) == Card.Void then
                room:moveCards({
                    ids = {id},
                    fromArea = Card.Void,
                    to = player.id,
                    toArea = Card.PlayerEquip,
                    moveReason = fk.ReasonJustMove,
                    proposer = player.id,
                    skillName = self.name,
                })
                if player:getEquipment(Card.SubtypeWeapon) and player:getEquipment(Card.SubtypeArmor) then
                    break
                end
            end
        end
    end 
  end
}

local l_aozhan = fk.CreateTriggerSkill{
  name = "l_aozhan",
  anim_type = "control",
  frequency = Skill.Compulsory,
  events = {fk.DrawNCards,fk.TargetSpecified,fk.EventPhaseStart,fk.EventPhaseEnd},
  can_trigger = function(self, event, target, player, data)
    if event == fk.DrawNCards then
        return player:hasSkill(self.name) and target == player
    elseif event == fk.TargetSpecified then
        return target == player and player:hasSkill(self.name) and data.from == player.id and player:getMark("l_aozhan_slash_mode") == 0 and not player:getEquipment(Card.SubtypeWeapon) and data.card and data.card.trueName == "slash"
    elseif event == fk.EventPhaseStart then
        -- body
        if player:hasSkill(self.name) and target == player and player.phase == Player.Play then
            if player:getEquipment(Card.SubtypeWeapon) then
                return true
            else
                player.room:setPlayerMark(player,"l_aozhan_slash_mode",0)
                return false
            end
        end
    else
        return player:hasSkill(self.name) and target.phase == Player.Finish and #player.player_cards[Player.Hand] <= player.maxHp and player ~= target
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if event == fk.DrawNCards then
        data.n = data.n + #room:getOtherPlayers(player)
    elseif event == fk.TargetSpecified then
        data.additionalDamage = (data.additionalDamage or 0) + 1
    elseif event == fk.EventPhaseStart then
        room:setPlayerMark(player,"l_aozhan_slash_mode",#room:getOtherPlayers(player))
    else
        room:drawCards(player,#room.alive_players > 4 and 3 or 2,self.name)
    end
  end,
}


local l_aozhan_tarmod = fk.CreateTargetModSkill{
  name = "#l_aozhan_tarmod",
  extra_target_func = function(self, player, skill)
    if skill.trueName == "slash_skill" and player:hasSkill("l_aozhan") and player:getMark("l_aozhan_slash_mode") == 0 and not player:getEquipment(Card.SubtypeWeapon) then
      return 2
    end
  end,
}

local l_aozhan_slashmod = fk.CreateTargetModSkill{
    name = "#l_aozhan_slashmod",
    residue_func = function(self, player, skill, scope)
        local room = player.room
        if skill.trueName == "slash_skill" and player:hasSkill("l_aozhan") and player:getMark("l_aozhan_slash_mode") > 0 then
            
            -- local op = room:getOtherPlayers(player)
            return player:getMark("l_aozhan_slash_mode")
        end
    end,
}

local l__hulaolvbu = General(extension,"l__hulaolvbu","qun",9)
l__hulaolvbu:addSkill(l_jingjia)
l__hulaolvbu:addSkill(l_aozhan)
l_aozhan:addRelatedSkill(l_aozhan_tarmod)
l_aozhan:addRelatedSkill(l_aozhan_slashmod)
-- l__yuanshu:addSkill(l_rongzhu)
Fk:loadTranslationTable{
    ["l__hulaolvbu"] = "虎牢关吕布",
    ["l_jingjia"] = "精甲",
    [":l_jingjia"] = "锁定技，游戏开始把你所属得装备（无双方天画戟）（玲珑狮带）置于你的装备区",

    ["l_aozhan"] = "鏖战",
    [":l_aozhan"] = "锁定技，摸牌阶段多摸X张牌，出牌阶段开始时若你装备区内有武器牌，你可以多使用X张【杀】；否则你使用【杀】指向目标+2且伤害+1;每名其他角色回合结束时，若你的手牌小于等于体力值上限则你摸两张牌(若存活角色数大于4改为摸3张)（X为总存活角色数）",

}

local extension_card = Package:new("fkpve_cards", Package.CardPack)
extension.game_modes_blacklist = {"m_1v1_mode", "m_1v2_mode", "m_2v2_mode", "zombie_mode", "heg_mode"}
extension.game_modes_whitelist = {"hulao_mode"}

--重写飞扬跋扈
local l_feiyang = fk.CreateTriggerSkill{
  name = "l_feiyang",
  anim_type = "control",
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self.name) and
      player.phase == Player.Judge and
      #player:getCardIds(Player.Hand) >= 2 and
      #player:getCardIds(Player.Judge) > 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:askForDiscard(player, 2, 2, false, self.name, false)
    local card = room:askForCardChosen(player, player, "j", self.name)
    room:throwCard(card, self.name, player, player)
  end
}
Fk:addSkill(l_feiyang)
local l_bahubuff = fk.CreateTargetModSkill{
  name = "#l_bahubuff",
  residue_func = function(self, player, skill, scope)
    if player:hasSkill(self.name) and skill.trueName == "slash_skill"
      and scope == Player.HistoryPhase then
      return 1
    end
  end,
}
local l_bahu = fk.CreateTriggerSkill{
  name = "l_bahu",
  anim_type = "drawcard",
  frequency = Skill.Compulsory,
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self.name) and
      player.phase == Player.Start
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1)
  end,
}
l_bahu:addRelatedSkill(l_bahubuff)
Fk:addSkill(l_bahu)

local yx_yvxi_skill = fk.CreateTriggerSkill{
  name = "#yx_yvxi_skill",
  attached_equip = "yx_yvxi",
}
Fk:addSkill(yx_yvxi_skill)
local yx_yvxi = fk.CreateTreasure{
  name = "yx_yvxi",
  suit = Card.Heart,
  number = 6,
  equip_skill = yx_yvxi_skill,
  on_install = function(self, room, player)
    if player:isAlive() and self.equip_skill:isEffectable(player) then
      room:handleAddLoseSkills(player,"l_feiyang|l_bahu", nil, true, false)
    end
  end,
  on_uninstall = function(self, room, player)
    if not player then return end
    if player:isAlive() and self.equip_skill:isEffectable(player) then
      room:handleAddLoseSkills(player,"-l_feiyang|-l_bahu", nil, true, false)
    end
  end,
}
extension_card:addCards{yx_yvxi}

Fk:loadTranslationTable{
  ["fkpve_cards"] = "浪包卡组",
  ["yx_yvxi"] = "玉玺",
  [":yx_yvxi"] = "装备牌·宝物<br /><b>技能</b>：锁定技：你视为拥有【飞扬】【跋扈】",
  ["#yx_yvxi_skill"] = "玉玺",
  ["l_feiyang"] = "飞扬",
  [":l_feiyang"] = "判定阶段开始时，你可以弃置两张手牌，然后弃置自己判定区的一张牌。",
  ["l_bahu"] = "跋扈",
  [":l_bahu"] = "锁定技，准备阶段，你摸一张牌；出牌阶段，你可以多使用一张【杀】。",
}

--虎牢关卡组
--玲珑狮蛮带
local llsmd_skill = fk.CreateTriggerSkill {
  name = "#llsmd_skill",
  attached_equip = "llsmd",
  events = { fk.TargetConfirming },
  can_trigger = function(self, event, target, player, data)
    
    return player:hasSkill(self.name) and data.to == player.id and data.from ~= data.to and  data.card and #AimGroup:getAllTargets(data.tos) == 1 and player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  on_cost = function(self, event, target, player, data)
    local room = target.room
    
    if room:askForSkillInvoke(target, self.name, data) then
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:notifySkillInvoked(target, self.name, "masochism")
    local judge = {
      who = target,
      reason = "#llsmd_skill",
      pattern = ".|.|heart",
    }
    room:judge(judge)
    local result = judge.card
    if result.suit == Card.Heart then
      AimGroup:cancelTarget(data, data.to)
    end
  end,
}
Fk:addSkill(llsmd_skill)

local llsmd = fk.CreateArmor {
  name = "&llsmd",
  suit = Card.Club,
  number = 1,
  equip_skill = llsmd_skill,
}

extension_card:addCards({
  llsmd,
})
Fk:loadTranslationTable {
  ["llsmd"] = "玲珑狮蛮带",
  [":llsmd"] = "装备牌·防具<br /><b>防具技能</b>每回合限一次，当你成为单体牌的目标时，你可以进行判定，若为红桃，取消之",
  ["#llsmd_skill"] = "玲珑狮蛮带",
}

--无双方天画戟
local wxfthj_skill = fk.CreateTriggerSkill {
  name = "#wxfthj_skill",
  attached_equip = "wxfthj",
  anim_type = "offensive",
  events = { fk.Damaged },
  can_trigger = function(self, event, target, player, data)
    
    return player ~= target and player:hasSkill(self.name) and data.from == player and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 and
        data.card and data.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    
    local chc = {"draw_1","discard_1"}
    if data.to.dead then
        table.remove(chc,2)
    end
    local chs = room:askForChoice(player,chc,self.name)
    if chs == "draw_1" then
        room:drawCards(player,1,self.name)
    else
        if not data.to:isNude() then
            -- room:askForDiscard(data.to,1,1,true,self.name,false)
            local cards = room:askForCardsChosen(player,data.to,1,1,"he",self.name)
            if #cards > 0 then
                room:throwCard(cards, self.name, data.to, player)
            end
        end
    end
    room:notifySkillInvoked(player, self.name, "defensive")
  end,
}
Fk:addSkill(wxfthj_skill)

local wxfthj = fk.CreateWeapon {
  name = "&wxfthj",
  suit = Card.Club,
  number = 1,
  attack_range = 4,
  equip_skill = wxfthj_skill,
}
extension_card:addCards({
  wxfthj,
})
Fk:loadTranslationTable {
  ["wxfthj"] = "无双方天画戟",
  [":wxfthj"] = "武器牌·武器<br /><b>攻击范围</b>：4<br /><b>武器技能</b>：每回合限一次，你使用【杀】造成伤害后，你可以摸一张牌或者弃之其一张牌",
  ["#wxfthj_skill"] = "无双方天画戟",
  ["draw_1"] = "摸1张牌",
  ["discard_1"] = "弃其1张牌",
}

--修罗神话吕布装备
--神话方天画戟
local shfthj_skill = fk.CreateTriggerSkill {
  name = "#shfthj_skill",
  attached_equip = "shfthj",
--   anim_type = "offensive",
  -- frequency = Skill.Compulsory,
  events = { fk.TargetConfirmed },
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(self.name) and data.from == player.id and #AimGroup:getAllTargets(data.tos) == 1 and data.card and (data.card.trueName == "slash" or data.card.name == "duel")
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    if room:askForSkillInvoke(player, self.name, data) then
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local target = room:getPlayerById(data.to)
    room:notifySkillInvoked(player, self.name, "offensive")
    local availableTargets = {}
    local othertarget = TargetGroup:getRealTargets(data.tos)
    for _, p in ipairs(room:getOtherPlayers(player)) do
      if not table.contains(othertarget, p.id) and not GensLimts:isSameCamp(player,p) then
        table.insert(availableTargets,p.id)
      end
    end
    
    local chc = {"draw_dis_1"}
    if #availableTargets > 0 then
      table.insert(chc,"addrandtar")
    end
    local chs = room:askForChoice(player,chc,self.name)
    if chs == "draw_dis_1" then
      room:drawCards(player,1,self.name)
      if not target:isNude() then
        local card = room:askForCardChosen(player, target, "he", self.name)
        room:throwCard(card, self.name, target, player)
      end
    else
      local randpids = table.random(availableTargets,1)
      if randpids and #randpids > 0 then
          room:doIndicate(player.id, randpids)
          table.forEach(randpids, function(pid)
              AimGroup:addTargets(room, data, pid)
          end)
      end
    end
  end,
}
Fk:addSkill(shfthj_skill)

local shfthj = fk.CreateWeapon {
  name = "&shfthj",
  suit = Card.Club,
  number = 6,
  attack_range = 4,
  equip_skill = shfthj_skill,
}
extension_card:addCards({
  shfthj,
})
Fk:loadTranslationTable {
  ["shfthj"] = "神话方天画戟",
  [":shfthj"] = "武器牌·武器<br /><b>攻击范围</b>：4<br /><b>武器技能</b>：你使用【杀】或【决斗】指向单一目标后，你可以选择：1.摸1牌并弃其1张牌。2.随机一名其他阵营角色也成为【杀】或【决斗】目标",
  ["#shfthj_skill"] = "神话方天画戟",
  ["addrandtar"] = "随机一名其他不同阵营的角色",
  ["draw_dis_1"] = "摸1张牌，弃其1张牌",
}

local shsfzjg_skill = fk.CreateTriggerSkill {
  name = "#shsfzjg_skill",
  attached_equip = "shsfzjg",
--   anim_type = "offensive",
  -- frequency = Skill.Compulsory,
  events = { fk.EventPhaseStart },
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self.name) and player.phase == Player.Play
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    if room:askForSkillInvoke(player, self.name, data) then
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:notifySkillInvoked(player, self.name, "offensive")
    local pids = table.filter(room:getOtherPlayers(player), function (pr)
      if not GensLimts:isSameCamp(player,pr) then
        return true
      end
    end)
    pids = table.map(pids,Util.IdMapper)
    local to = table.random(pids)
    if #pids > 0 then
      room:doIndicate(player.id, {to})
      local tar = room:getPlayerById(to)
      room:damage { from = player, to = tar, damage = 1, skillName = self.name }
      local total_cards = tar:getCardIds{Player.Hand, Player.Equip}
      room:throwCard(table.random(total_cards,1),self.name, tar, player)
    end
  end,
}

Fk:addSkill(shsfzjg_skill)
local shsfzjg = fk.CreateTreasure {
  name = "&shsfzjg",
  suit = Card.Spade,
  number = 6,
  equip_skill = shsfzjg_skill,
}
extension_card:addCard(shsfzjg)

Fk:loadTranslationTable {
  ["shsfzjg"] = "神话束发紫金冠",
  [":shsfzjg"] = "装备牌·宝物<br /><b>宝物技能</b>：出牌阶段，你可以对一名其他阵营角色造成一点伤害并随机弃其一张牌。",
  ["#shsfzjg_skill"] = "神话束发紫金冠",
  ["#shsfzjg-choose"] = "神话束发紫金冠：你可以对一名其他角色造成一点伤害并随机弃其一张牌。",
}

--神话吞天铠
local shttk_skill = fk.CreateTriggerSkill {
  name = "#shttk_skill",
  attached_equip = "shttk",
--   anim_type = "support",
  -- frequency = Skill.Compulsory,
  events = { fk.TargetConfirming,fk.Damaged },
  can_trigger = function(self, event, target, player, data)
    
    if event == fk.TargetConfirming then
      return player:hasSkill(self.name) and data.to == player.id and data.from ~= data.to and  data.card and not data.card:isVirtual() and #AimGroup:getAllTargets(data.tos) == 1 and player:usedSkillTimes(self.name, Player.HistoryTurn) < 2
    else
      return player:hasSkill(self.name) and player == target
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    -- room:notifySkillInvoked(target, self.name, "masochism")
    room:notifySkillInvoked(player, self.name, "defensive")
    if event == fk.TargetConfirming then
      local hand_cards = player.player_cards[Player.Hand]
      if data.card.color == Card.Red then
        local red_cards = {}
        table.forEach(hand_cards,function(cid)
          if Fk:getCardById(cid).color == Card.Red then
              table.insert(red_cards,cid)
          end
        end)
        if #red_cards > 1 then
          room:throwCard(table.random(red_cards,2), self.name, player, player)
          room:damage { from = player, to = room:getPlayerById(data.from), damage = 1, skillName = self.name }
        end
      elseif data.card.color == Card.Black then
        local black_cards = {}
        table.forEach(hand_cards,function(cid)
          if Fk:getCardById(cid).color == Card.Black then
              table.insert(black_cards,cid)
          end
        end)
        if #hand_cards > 0 then
          room:throwCard(table.random(black_cards,1), self.name, player, player)
          local to = room:getPlayerById(data.from)
          local total_cards = {}
          table.forEach(to.player_cards[Player.Hand],function(cid)
              table.insert(total_cards,cid)
          end)
          table.forEach(to.player_cards[Player.Equip],function(cid)
              table.insert(total_cards,cid)
          end)
          room:throwCard(table.random(total_cards,1), self.name, to, player)
        end
      end
    else
      room:drawCards(player,data.damage,self.name)
    end
  end,
}
Fk:addSkill(shttk_skill)

local shttk = fk.CreateArmor {
  name = "&shttk",
  suit = Card.Heart,
  number = 6,
  equip_skill = shttk_skill,
}

extension_card:addCards({
  shttk,
})
Fk:loadTranslationTable {
  ["shttk"] = "神话吞天铠",
  [":shttk"] = "装备牌·防具<br /><b>防具技能</b>每回合限两次，当你成为非虚拟单体牌的目标时，若牌的颜色为红色，你随机弃两张红色手牌对其造成1点伤害，若为黑色，你弃一张黑色手牌随机弃其一张牌；每当你受到伤害时，摸受到伤害值的牌",
  ["#shttk_skill"] = "神话吞天铠",
}
--伏魔金刚杵
local fm_jingang_Skill = fk.CreateTriggerSkill {
  name = "#fm_jingang_skill",
  attached_equip = "fm_jingang",
  -- anim_type = "offensive",
  priority = 0,
  frequency = Skill.Compulsory,
  events = { fk.TargetSpecified, fk.DamageCaused },
  can_trigger = function(self, event, target, player, data)
    if event == fk.DamageCaused then
      return target == player and player:hasSkill(self.name) and data.to:getEquipment(Card.SubtypeArmor) and data.card and
          data.card.trueName == "slash" and not data.chain
    else
      return target == player and player:hasSkill(self.name) and data.card and data.card.trueName == "slash"
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if event == fk.DamageCaused then
      data.damage = data.damage + 1
    else
      room:addPlayerMark(room:getPlayerById(data.to), fk.MarkArmorNullified)
      data.extra_data = data.extra_data or {}
      data.extra_data.vajraNullified = data.extra_data.vajraNullified or {}
      data.extra_data.vajraNullified[tostring(data.to)] = (data.extra_data.vajraNullified[tostring(data.to)] or 0) + 1
      room:notifySkillInvoked(player, self.name, "defensive")
    end
  end,

  refresh_events = { fk.CardUseFinished },
  can_refresh = function(self, event, target, player, data)
    return data.extra_data and data.extra_data.vajraNullified
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    for key, num in pairs(data.extra_data.vajraNullified) do
      local p = room:getPlayerById(tonumber(key))
      if p:getMark(fk.MarkArmorNullified) > 0 then
        room:removePlayerMark(p, fk.MarkArmorNullified, num)
      end
    end

    data.vajraNullified = nil
  end,
}
Fk:addSkill(fm_jingang_Skill)

local fm_jingang = fk.CreateWeapon {
  name = "&fm_jingang",
  suit = Card.Spade,
  number = 3,
  attack_range = 3,
  equip_skill = fm_jingang_Skill,
}
extension_card:addCard(fm_jingang)
Fk:loadTranslationTable {
  ["fm_jingang"] = "伏魔金刚杵",
  [":fm_jingang"] = "装备牌·武器<br /><b>攻击范围</b>：3<br /><b>武器技能</b>：锁定技。你的【杀】无视目标角色的防具，且【杀】对有防具的目标造成的伤害+1。",
  ["#fm_jingang_skill"] = "伏魔金刚杵",
}

--思召剑
local sw_sizhao_skill = fk.CreateTriggerSkill {
  name = "#sw_sizhao_skill",
  attached_equip = "sw_sizhao",
  anim_type = "negative",
  -- frequency = Skill.Compulsory,
  events = {fk.TargetSpecified,fk.CardUseFinished},
  can_trigger = function(self, event, target, player, data)
    if not player:hasSkill(self) then return end
    return target == player and data.card and data.card.trueName == "slash"
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    if event == fk.CardUseFinished then return true end
    return room:askForSkillInvoke(player, self.name, nil, "sw_sizhao_invoke::"..data.to)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if event == fk.TargetSpecified then 
      local to = room:getPlayerById(data.to)
      room:setPlayerMark(to,"sizhao_disjink",data.card.number)
    else
      for _,pr in ipairs(room.alive_players) do
        if pr:getMark("sizhao_disjink") ~= 0 then
          room:setPlayerMark(pr,"sizhao_disjink",0)
        end
      end
    end
  end,
}
local sizhao_prohibit = fk.CreateProhibitSkill{
  name = "#sizhao_prohibit",
  prohibit_use = function(self, player, card)
    local disjink_mark = player:getMark("sizhao_disjink")
    return disjink_mark ~= 0 and card.name == "jink" and card.number < disjink_mark
  end,
}
sw_sizhao_skill:addRelatedSkill(sizhao_prohibit)
Fk:addSkill(sw_sizhao_skill)

local sw_sizhao = fk.CreateWeapon {
  name = "&sw_sizhao",
  suit = Card.Spade,
  number = 13,
  attack_range = 2,
  equip_skill = sw_sizhao_skill,
}

extension_card:addCards({
  sw_sizhao,
})
Fk:loadTranslationTable {
  ["sw_sizhao"] = "思召剑",
  [":sw_sizhao"] = "装备牌·武器<br /><b>攻击范围</b>：2<br /><b>武器技能</b>：目标角色只能使用大于等于你使用【杀】点数的闪",
  ["sw_sizhao_invoke"] = "是否让%dest无法使用小于此杀点数的闪",
  ["#sizhao_prohibit"] = "无法使用",
  ["#sw_sizhao_skill"] = "思召剑",
}

--神威飞将剑
local sw_feijiang_skill = fk.CreateTriggerSkill {
  name = "#sw_feijiang_skill",
  attached_equip = "sw_feijiang",
  -- anim_type = "offensive",
  priority = 0,
  frequency = Skill.Compulsory,
  events = { fk.Damage },
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self.name) and player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and
        data.card and data.card.trueName == "slash" and
        not data.chain
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:notifySkillInvoked(player, self.name, "drawcard")
    room:loseHp(data.to, 1, "sw_feijiang")
    data.to:drawCards(1, "sw_feijiang")
  end,
}
Fk:addSkill(sw_feijiang_skill)

local sw_feijiang = fk.CreateWeapon {
  name = "&sw_feijiang",
  suit = Card.Spade,
  number = 6,
  attack_range = 2,
  equip_skill = sw_feijiang_skill,
}

extension_card:addCards({
  sw_feijiang,
})
Fk:loadTranslationTable {
  ["sw_feijiang"] = "神威飞将剑",
  [":sw_feijiang"] = "装备牌·武器<br /><b>攻击范围</b>：２<br /><b>武器技能</b>：每回合限一次，锁定技，当你使用【杀】对目标造成伤害后，令其失去一点体力值，然后你摸一张牌。",
  ["#sw_feijiang_skill"] = "神威飞将剑",
}
--血影刀
local xyd_xueyingdao_skill = fk.CreateTriggerSkill {
  name = "#xyd_xueyingdao_skill",
  attached_equip = "xyd_xueyingdao",
  -- anim_type = "offensive",
  events = { fk.DamageCaused },
  can_trigger = function(self, event, target, player, data)
    
    return player == target and player:hasSkill(self.name) and player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and
        data.card and data.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    
    if player:isWounded() then
      room:recover({
        who = player,
        num = data.damage,
        recoverBy = player,
        skillName = self.name
      })
    else
      room:changeShield(player, data.damage)
    end
    room:notifySkillInvoked(player, self.name, "defensive")
  end,
}
Fk:addSkill(xyd_xueyingdao_skill)

local xyd_xueyingdao = fk.CreateWeapon {
  name = "&xyd_xueyingdao",
  suit = Card.Club,
  number = 1,
  attack_range = 2,
  equip_skill = xyd_xueyingdao_skill,
}
extension_card:addCards({
  xyd_xueyingdao,
})
Fk:loadTranslationTable {
  ["xyd_xueyingdao"] = "血影刀",
  [":xyd_xueyingdao"] = "武器牌·武器<br /><b>攻击范围</b>：2<br /><b>武器技能</b>：每回合限一次，你使用【杀】造成伤害后，你回复伤害值的血量，体力值满则改为护甲",
  ["#xyd_xueyingdao_skill"] = "血影刀",
}

--联军盛宴
local ljsySkill = fk.CreateActiveSkill{
  name = "ljsy_skill",
--   can_use = Util.GlobalCanUse,
--   on_use = Util.GlobalOnUse,
  mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
    local room = Fk:currentRoom()
    local tar = room:getPlayerById(to_select)
    local carduser = room:getPlayerById(user)
    return tar and carduser and tar.role == carduser.role
  end,
  target_filter = function(self, to_select, selected)
    -- if #selected <= 1 then
      return self:modTargetFilter(to_select, selected, Self.id)
    -- end
  end,

  can_use = function(self, player, card)
    for _, p in ipairs(Fk:currentRoom().alive_players) do
      if not player:isProhibited(p, card) and self:modTargetFilter(p.id, {}, player.id, card, true) then
        return true
      end
    end
  end,

  on_use = function(self, room, cardUseEvent)
    if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
        cardUseEvent.tos = {}
        for _, p in ipairs(room:getAlivePlayers()) do
            if not room:getPlayerById(cardUseEvent.from):isProhibited(p, cardUseEvent.card) and self:modTargetFilter(p.id, {}, cardUseEvent.from, cardUseEvent, true) then
                TargetGroup:pushTargets(cardUseEvent.tos, p.id)
            end
        end
    end
  end,
  
  on_effect = function(self, room, effect)
    local player = room:getPlayerById(effect.from)
    local target = room:getPlayerById(effect.to)
    if player == target then
        room:drawCards(player,math.min(#room:getAlivePlayers(),4),self.name)
    else
        if not target.dead and target.role == player.role then
            if target:isWounded() then
                room:recover({
                    who = target,
                    num = 1,
                    recoverBy = player,
                    card = effect.card,
                    skillName = self.name,
                })
            else
                room:drawCards(target,1,self.name)
            end
        end
    end
  end
}
local ljsy = fk.CreateTrickCard{
  name = "ljsy",
  suit = Card.Heart,
  number = 1,
  multiple_targets = true,
  skill = ljsySkill,
}

extension_card:addCards({
  ljsy,
--   ljsy:clone(Card.Heart, 2),
--   ljsy:clone(Card.Heart, 3),
--   ljsy:clone(Card.Heart, 4),
  ljsy:clone(Card.Heart, 5),
  ljsy:clone(Card.Heart, 6),
})
Fk:loadTranslationTable {
  ["ljsy"] = "联军盛宴",
  [":ljsy"] = "锦囊牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：所有角色<br /><b>效果</b>：其他相同身份角色回复1点体力（若满血则摸1张牌）。自己摸存活角色数的牌",
}

--------------------------------自定义风华绝代卡组-----------------------------------------
--------------------------------自定义风华绝代卡组-----------------------------------------
--------------------------------自定义风华绝代卡组-----------------------------------------
--------------------------------自定义风华绝代卡组-----------------------------------------
-- local nullFunc = function() end
-- local preLoadCard = function(c)  --
--   if Fk.all_card_types[c.name] == nil then
--     Fk.skills[c.skill.name] = c.skill
--     Fk.all_card_types[c.name] = c
--   end
-- end
-- --护甲
-- local clone_ex_nihilo = Fk:cloneCard("ex_nihilo")
-- local defshieldSkill = fk.CreateActiveSkill{
--   name = "defshield_skill",
--   prompt = "#defshield_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = clone_ex_nihilo.skill.canUse,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local defShield = fk.CreateBasicCard{
--   name = "defshield",
--   suit = Card.Diamond,
--   number = 1,
--   skill = defshieldSkill,
-- }
-- preLoadCard(defShield)
-- extension_card:addCards({
--   defShield,
--   defShield:clone(Card.Diamond, 4),
--   defShield:clone(Card.Diamond, 8),
--   defShield:clone(Card.Diamond, 12),
--   defShield:clone(Card.Club, 1),
--   defShield:clone(Card.Club, 4),
--   defShield:clone(Card.Club, 8),
--   defShield:clone(Card.Club, 12),
--   defShield:clone(Card.Heart, 1),
--   defShield:clone(Card.Heart, 4),
--   defShield:clone(Card.Heart, 8),
--   defShield:clone(Card.Heart, 12),
--   defShield:clone(Card.Spade, 1),
--   defShield:clone(Card.Spade, 4),
--   defShield:clone(Card.Spade, 8),
--   defShield:clone(Card.Spade, 12),
-- })
-- Fk:loadTranslationTable {
--   ["defshield"] = "护甲",
--   [":defshield"] = "基本牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：获得+1护甲",
--   ["#defshield_skill"] = "获得1护甲",
-- }

-- local clone_slash = Fk:cloneCard("slash")
-- --猛杀
-- local strongSlashSkill = fk.CreateActiveSkill{
--   name = "strong__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local strongHurtSkill = fk.CreateTriggerSkill{
--   name = "strong_hurt_skill",
--   anim_type = "control",
--   frequency = Skill.Compulsory,
--   events = {fk.DamageFinished,fk.TurnEnd},
--   can_trigger = function (self, event, target, player, data)
--     if not player:hasSkill(self.name) then return end
--     if event == fk.DamageFinished then
--       return data.card and data.to and data.to == player and data.to:getMark("@strong_hurt") > 0
--     else
--       return player == target
--     end
--   end,
--   on_use = function(self, event, target, player, data)
--     local room = player.room
--     if event == fk.DamageFinished then
--       local tatal_damaged = player:getMark("tatal_damaged")
--       local per_damage = data.damage / 2
--       local mod_damage = data.damage % 2
--       per_damage = per_damage > 0 and math.floor(per_damage) or 0
--       mod_damage = (mod_damage + tatal_damaged) % 2 == 0 and 1 or 0
--       room:setPlayerMark(player,"tatal_damaged",tatal_damaged+data.damage)
--       if per_damage + mod_damage > 0 then
--         room:damage({
--           to = player,
--           damage = per_damage + mod_damage,
--           damageType = fk.NormalDamage,
--           skillName = self.name
--         })
--       end
--     else
--       local mark = player:getMark("@strong_hurt")
--        room:setPlayerMark(player,"@strong_hurt",mark-1)
--       if mark - 1 <= 0 then
--         room:handleAddLoseSkills(player, "-strong_hurt_skill", nil, false)
--       end
--     end
--   end,
-- }
-- Fk:addSkill(strongHurtSkill)
-- local strongSlash = fk.CreateBasicCard{
--   name = "strong__slash",
--   skill = strongSlashSkill,
--   suit = Card.Spade,
--   number = 8,
--   is_damage_card = true,
-- }
-- preLoadCard(strongSlash)
-- extension_card:addCards{
--   strongSlash,
--   strongSlash:clone(Card.Spade, 10),
--   strongSlash:clone(Card.Club, 8),
--   strongSlash:clone(Card.Club, 10),
-- }
-- Fk:loadTranslationTable{
--   ["strong__slash"] = "猛杀",
--   ["strong__slash_skill"] = "对目标角色造成1点伤害并且目标获得2层【重伤】。【重伤】：每当受到两点伤害会额外受到1点伤害，回合结束层数-1",
-- 	[":strong__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成1点伤害并且目标获得2层【重伤】。【重伤】：每当受到两点伤害会额外受到1点伤害，回合结束层数-1",
--   ["#strong__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点重伤伤害",
--   ["#strong__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点重伤伤害",
--   ["strong_hurt_skill"] = "重伤",
--   ["@strong_hurt"] = "重伤",
--   [":strong_hurt_skill"] = "每当受到两点伤害会额外受到1点伤害，回合结束层数-1",
-- }
-- --残杀
-- local weakSlashSkill = fk.CreateActiveSkill{
--   name = "weak__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local weakHurtSkill = fk.CreateTriggerSkill{
--   name = "weak_hurt_skill",
--   anim_type = "control",
--   frequency = Skill.Compulsory,
--   events = {fk.DamageInflicted,fk.TurnEnd},
--   can_trigger = function (self, event, target, player, data)
--     if not player:hasSkill(self.name) then return end
--     if event == fk.DamageInflicted then
--       return data.card and data.from and data.from == player and data.from:getMark("@weak_hurt") > 0
--     else
--       return player == target
--     end
--   end,
--   on_use = function(self, event, target, player, data)
--     local room = player.room
--     if event == fk.DamageInflicted then
--       local tatal_damage = player:getMark("tatal_damage")
--       local per_damage = data.damage / 2
--       local mod_damage = data.damage % 2
--       per_damage = per_damage > 0 and math.floor(per_damage) or 0
--       mod_damage = (mod_damage + tatal_damage) % 2 == 0 and 1 or 0
--       room:setPlayerMark(player,"tatal_damage",tatal_damage + data.damage)
--       if per_damage + mod_damage > 0 then
--         data.damage = data.damage - (per_damage + mod_damage) 
--       end
--     else
--       local mark = player:getMark("@weak_hurt")
--        room:setPlayerMark(player,"@weak_hurt",mark-1)
--       if mark - 1 <= 0 then
--         room:handleAddLoseSkills(player, "-weak_hurt_skill", nil, false)
--       end
--     end
--   end,
-- }
-- Fk:addSkill(weakHurtSkill)
-- local weakSlash = fk.CreateBasicCard{
--   name = "weak__slash",
--   skill = weakSlashSkill,
--   suit = Card.Spade,
--   number = 4,
--   is_damage_card = true,
-- }
-- preLoadCard(weakSlash)
-- extension_card:addCards{
--   weakSlash,
--   weakSlash:clone(Card.Spade, 6),
--   weakSlash:clone(Card.Club, 4),
--   weakSlash:clone(Card.Club, 6),
-- }
-- Fk:loadTranslationTable{
--   ["weak__slash"] = "残杀",
--   ["weak__slash_skill"] = "对目标角色造成1点伤害并且目标获得2层【虚弱】。【虚弱】：每当造成两点伤害前会减少1的伤害，回合结束层数-1",
-- 	[":weak__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成1点伤害并且目标获得2层【虚弱】。【虚弱】：每当造成两点伤害前会减少1的伤害，回合结束层数-1",
--   ["#weak__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点残杀伤害",
--   ["#weak__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点残杀伤害",
--   ["weak_hurt_skill"] = "虚弱",
--   ["@weak_hurt"] = "虚弱",
--   [":weak_hurt_skill"] = "每当造成两点伤害前会减少1的伤害，回合结束层数-1",
-- }
-- --盾杀
-- local shieldSlashSkill = fk.CreateActiveSkill{
--   name = "shield__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local shieldSlash = fk.CreateBasicCard{
--   name = "shield__slash",
--   skill = shieldSlashSkill,
--   suit = Card.Heart,
--   number = 1,
--   is_damage_card = true,
-- }
-- preLoadCard(shieldSlash)
-- extension_card:addCards{
--   shieldSlash,
--   shieldSlash:clone(Card.Heart, 2),
--   shieldSlash:clone(Card.Diamond, 3),
--   shieldSlash:clone(Card.Diamond, 4),
-- }
-- Fk:loadTranslationTable{
--   ["shield__slash"] = "盾杀",
--   ["shield__slash_skill"] = "对目标角色造成1点伤害并且目标获得1层【护甲】",
-- 	[":shield__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成1点伤害并且目标获得1层【护甲】",
--   ["#shield__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点杀伤害",
--   ["#shield__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点杀伤害",
-- }
-- --杀意
-- local likeSlashSkill = fk.CreateActiveSkill{
--   name = "like__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local likeSlash = fk.CreateBasicCard{
--   name = "like__slash",
--   skill = likeSlashSkill,
--   suit = Card.Heart,
--   number = 7,
--   is_damage_card = true,
-- }
-- preLoadCard(likeSlash)
-- extension_card:addCards{
--   likeSlash,
--   likeSlash:clone(Card.Club, 8),
--   likeSlash:clone(Card.Diamond, 9),
--   likeSlash:clone(Card.Spade, 10),
-- }
-- Fk:loadTranslationTable{
--   ["like__slash"] = "杀意",
--   ["like__slash_skill"] = "你手牌每有3张基本伤害牌，伤害+1",
-- 	[":like__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：你手牌每有3张基本伤害牌，伤害+1",
--   ["#like__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点杀伤害",
--   ["#like__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点杀伤害",
-- }
-- --独杀
-- local aloneSlashSkill = fk.CreateActiveSkill{
--   name = "alone__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = function(self, player, card, extra_data)
--     return #player.player_cards[Player.Hand] == 1 and ((extra_data and extra_data.bypass_times) or player.phase ~= Player.Play or
--     table.find(Fk:currentRoom().alive_players, function(p)
--       return self:withinTimesLimit(player, Player.HistoryPhase, card, "slash", p)
--     end))
--   end,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local aloneSlash = fk.CreateBasicCard{
--   name = "alone__slash",
--   skill = aloneSlashSkill,
--   suit = Card.Heart,
--   number = 1,
--   is_damage_card = true,
-- }
-- preLoadCard(aloneSlash)
-- extension_card:addCards{
--   aloneSlash,
--   aloneSlash:clone(Card.Club, 2),
--   aloneSlash:clone(Card.Diamond, 3),
--   aloneSlash:clone(Card.Spade, 4),
-- }
-- Fk:loadTranslationTable{
--   ["alone__slash"] = "独杀",
--   ["alone__slash_skill"] = "当你手牌只剩独杀才可以打出，造成3点伤害",
-- 	[":alone__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：当你手牌只剩独杀才可以打出，造成3点伤害",
--   ["#alone__slash_skill"] = "选择攻击范围内的一名角色，对其造成3点独杀伤害",
--   ["#alone__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成3点独杀伤害",
-- }
-- --抽杀
-- local drawSlashSkill = fk.CreateActiveSkill{
--   name = "draw__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local drawSlash = fk.CreateBasicCard{
--   name = "draw__slash",
--   skill = drawSlashSkill,
--   suit = Card.Spade,
--   number = 8,
--   is_damage_card = true,
-- }
-- preLoadCard(drawSlash)
-- extension_card:addCards{
--   drawSlash,
--   drawSlash:clone(Card.Spade, 10),
--   drawSlash:clone(Card.Club, 8),
--   drawSlash:clone(Card.Club, 10),
-- }
-- Fk:loadTranslationTable{
--   ["draw__slash"] = "抽杀",
--   ["draw__slash_skill"] = "对目标角色造成1点伤害并且摸1张牌",
-- 	[":draw__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成1点伤害并且摸1张牌",
--   ["#draw__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点抽伤伤害",
--   ["#draw__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点抽伤伤害",
-- }
-- --双杀
-- local doubleSlashSkill = fk.CreateActiveSkill{
--   name = "double__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local doubleSlash = fk.CreateBasicCard{
--   name = "double__slash",
--   skill = doubleSlashSkill,
--   suit = Card.Spade,
--   number = 8,
--   is_damage_card = true,
-- }
-- preLoadCard(doubleSlash)
-- extension_card:addCards{
--   doubleSlash,
--   doubleSlash:clone(Card.Spade, 10),
--   doubleSlash:clone(Card.Club, 8),
--   doubleSlash:clone(Card.Club, 10),
-- }
-- Fk:loadTranslationTable{
--   ["double__slash"] = "双杀",
--   ["double__slash_skill"] = "对目标角色造成1点伤害，连续两次",
-- 	[":double__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成1点伤害，连续两次",
--   ["#double__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点双伤伤害",
--   ["#double__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点双伤伤害",
-- }
-- --拔刀杀
-- local bdslashSkill = fk.CreateActiveSkill{
--   name = "bdslash_skill",
--   prompt = "#bdslash_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = clone_ex_nihilo.skill.canUse,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local bdSlash = fk.CreateBasicCard{
--   name = "bd__slash",
--   suit = Card.Diamond,
--   number = 1,
--   skill = bdslashSkill,
--   is_damage_card = true
-- }
-- preLoadCard(bdSlash)
-- extension_card:addCards({
--   bdSlash,
--   bdSlash:clone(Card.Diamond, 4),
--   bdSlash:clone(Card.Diamond, 8),
--   bdSlash:clone(Card.Diamond, 12),
-- })
-- Fk:loadTranslationTable {
--   ["bd__slash"] = "拔刀杀",
--   [":bd__slash"] = "基本牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：对所有敌人造成1点伤害",
--   ["#bdslash_skill"] = "对所有敌人造成1点伤害",
-- }
-- --冲杀
-- local rushSlashSkill = fk.CreateActiveSkill{
--   name = "rush__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local rushSlash = fk.CreateBasicCard{
--   name = "rush__slash",
--   skill = rushSlashSkill,
--   suit = Card.Spade,
--   number = 8,
--   is_damage_card = true,
-- }
-- preLoadCard(rushSlash)
-- extension_card:addCards{
--   rushSlash,
--   rushSlash:clone(Card.Spade, 10),
--   rushSlash:clone(Card.Club, 8),
--   rushSlash:clone(Card.Club, 10),
-- }
-- Fk:loadTranslationTable{
--   ["rush__slash"] = "冲杀",
--   ["rush__slash_skill"] = "对目标角色造成格挡值伤害",
-- 	[":rush__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成格挡值伤害",
--   ["#rush__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点冲杀伤害",
--   ["#rush__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点冲杀伤害",
-- }
-- --备杀
-- local U = require "packages/utility/utility"
-- local drawdisSlashSkill = fk.CreateActiveSkill{
--   name = "drawdis__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local drawdisSlash = fk.CreateBasicCard{
--   name = "drawdis__slash",
--   skill = drawdisSlashSkill,
--   suit = Card.Spade,
--   number = 8,
--   is_damage_card = true,
-- }
-- preLoadCard(drawdisSlash)
-- extension_card:addCards{
--   drawdisSlash,
--   drawdisSlash:clone(Card.Spade, 10),
--   drawdisSlash:clone(Card.Club, 8),
--   drawdisSlash:clone(Card.Club, 10),
-- }
-- Fk:loadTranslationTable{
--   ["drawdis__slash"] = "备杀",
--   ["drawdis__slash_skill"] = "对目标角色造成1点伤害并从弃牌堆获得1张牌",
-- 	[":drawdis__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成1点伤害并从弃牌堆获得1张牌",
--   ["#drawdis__slash_skill"] = "选择攻击范围内的一名角色，对其造成1点备杀伤害",
--   ["#drawdis__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成1点备杀伤害",
--   ["selcardbydiscs"] = "弃牌堆选卡",
--   ["fhjd_selcard"] = "选卡"
-- }
-- --狂杀
-- local crazySlashSkill = fk.CreateActiveSkill{
--   name = "crazy__slash_skill",
--   prompt = clone_slash.skill.prompt,
--   max_phase_use_time = 1,
--   target_num = 1,
--   can_use = clone_slash.skill.canUse,
--   mod_target_filter = clone_slash.skill.modTargetFilter,
--   target_filter = clone_slash.skill.targetFilter,
--   on_effect = nullFunc
-- }
-- local crazySlash = fk.CreateBasicCard{
--   name = "crazy__slash",
--   skill = crazySlashSkill,
--   suit = Card.Spade,
--   number = 8,
--   is_damage_card = true,
-- }
-- preLoadCard(crazySlash)
-- extension_card:addCards{
--   crazySlash,
-- }
-- Fk:loadTranslationTable{
--   ["crazy__slash"] = "狂杀",
--   ["crazy__slash_skill"] = "对目标角色造成3点伤害并在抽牌堆放一张【受伤】卡牌",
-- 	[":crazy__slash"] = "基本牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：攻击范围内的一名角色<br /><b>效果</b>：对目标角色造成3点伤害并在抽牌堆放一张【受伤】卡牌",
--   ["#crazy__slash_skill"] = "选择攻击范围内的一名角色，对其造成3点狂杀伤害",
--   ["#crazy__slash_skill_multi"] = "选择攻击范围内的至多%arg名角色，对这些角色各造成3点狂杀伤害",
-- }
-- --技能牌
-- --燃烧
-- local burnSkill = fk.CreateActiveSkill{
--   name = "burn_skill",
--   prompt = "#burn_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = function(self, player, card)
--     return not player:isProhibited(player, card) and #player.player_cards[Player.Hand] ~= 1
--   end,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local burnHot = fk.CreateTrickCard{
--   name = "burnHot",
--   suit = Card.Diamond,
--   number = 1,
--   skill = burnSkill,
-- }
-- preLoadCard(burnHot)
-- extension_card:addCards({
--   burnHot,
--   burnHot:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["burnHot"] = "燃烧",
--   [":burnHot"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：选择1张牌消耗，摸2张牌",
--   ["#burn_skill"] = "选择1张牌消耗，摸2张牌",
-- }
-- --武装
-- local equipselfSkill = fk.CreateActiveSkill{
--   name = "equipself_skill",
--   prompt = "#equipself_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = function(self, player, card)
--     return not player:isProhibited(player, card) and #player.player_cards[Player.Hand] ~= 1
--   end,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local equipSelf = fk.CreateTrickCard{
--   name = "equipSelf",
--   suit = Card.Diamond,
--   number = 1,
--   skill = equipselfSkill,
-- }
-- preLoadCard(equipSelf)
-- extension_card:addCards({
--   equipSelf,
--   equipSelf:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["equipSelf"] = "武装",
--   [":equipSelf"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：选择1张牌升级仅限本次战斗（升级此卡则是改为手牌）",
--   ["#equipself_skill"] = "选择1张牌升级仅限本次战斗（升级此卡则是改为手牌）",
-- }
-- --逞强
-- local bravadoSkill = fk.CreateActiveSkill{
--   name = "bravado_skill",
--   prompt = "#bravado_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = clone_ex_nihilo.skill.canUse,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local bravadoskill = fk.CreateTriggerSkill{
--   name = "bravadoskill",
--   anim_type = "control",
--   frequency = Skill.Compulsory,
--   events = {fk.TurnEnd},
--   can_trigger = function (self, event, target, player, data)
--     if not player:hasSkill(self.name) then return end
--     return player == target
--   end,
--   on_use = function(self, event, target, player, data)
--     local room = player.room
--     if room.logic.class.name == Fhjd_Mode then
--       local mark = player:getMark("@hfjd_power")
--       room:setPlayerMark(player,"@hfjd_power",mark-(1+fhjdExtraAdd(room,effect.card,"@up_power")))
--       if mark - 1 <= 0 then
--         room:handleAddLoseSkills(player, "-bravadoskill", nil, false)
--       end
--     end
--   end,
-- }
-- Fk:addSkill(bravadoskill)
-- local bravaDo = fk.CreateTrickCard{
--   name = "bravaDo",
--   suit = Card.Diamond,
--   number = 1,
--   skill = bravadoSkill,
-- }
-- preLoadCard(bravaDo)
-- extension_card:addCards({
--   bravaDo,
--   bravaDo:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["bravaDo"] = "逞强",
--   ["bravadoskill"] = "逞强",
--   [":bravaDo"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：获得1点力量，结束阶段失去1点力量",
--   ["#bravado_skill"] = "获得1点力量，结束阶段失去1点力量",
-- }
-- --破灭
-- local fallthroughSkill = fk.CreateActiveSkill{
--   name = "fallthrough_skill",
--   prompt = "#fallthrough_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = clone_ex_nihilo.skill.canUse,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local fallThrough = fk.CreateTrickCard{
--   name = "fallThrough",
--   suit = Card.Diamond,
--   number = 1,
--   skill = fallthroughSkill,
-- }
-- preLoadCard(fallThrough)
-- extension_card:addCards({
--   fallThrough,
--   fallThrough:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["fallThrough"] = "破灭",
--   [":fallThrough"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：打出抽牌堆1张牌，将其消耗",
--   ["#fallthrough_skill"] = "打出抽牌堆1张牌，将其消耗",
--   ["#fallthrough_skill_choose"] = "选择其他一名角色"
-- }
-- --无畏
-- local fearlessSkill = fk.CreateActiveSkill{
--   name = "fearless_skill",
--   prompt = "#fearless_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = clone_ex_nihilo.skill.canUse,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local fearLess = fk.CreateTrickCard{
--   name = "fearLess",
--   suit = Card.Diamond,
--   number = 1,
--   skill = fearlessSkill,
-- }
-- preLoadCard(fearLess)
-- extension_card:addCards({
--   fearLess,
--   fearLess:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["fearLess"] = "无畏",
--   [":fearLess"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：摸1张牌获得1护甲",
--   ["#fearless_skill"] = "摸1张牌获得1护甲",
-- }
-- --坚毅
-- local unwaverSkill = fk.CreateActiveSkill{
--   name = "unwaver_skill",
--   prompt = "#unwaver_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = function(self, player, card)
--     return not player:isProhibited(player, card) and #player.player_cards[Player.Hand] ~= 1
--   end,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local unWaver = fk.CreateTrickCard{
--   name = "unWaver",
--   suit = Card.Diamond,
--   number = 1,
--   skill = unwaverSkill,
-- }
-- preLoadCard(unWaver)
-- extension_card:addCards({
--   unWaver,
--   unWaver:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["unWaver"] = "坚毅",
--   [":unWaver"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：消耗1张牌获得1护甲",
--   ["#unwaver_skill"] = "消耗1张牌获得1护甲",
-- }
-- --双持
-- local cloneDoubleSkill = fk.CreateActiveSkill{
--   name = "clonedouble_skill",
--   prompt = "#clonedouble_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = clone_ex_nihilo.skill.canUse,
--   on_use = clone_ex_nihilo.skill.onUse,
--   on_effect = nullFunc
-- }
-- local cloneDouble = fk.CreateTrickCard{
--   name = "cloneDouble",
--   suit = Card.Diamond,
--   number = 1,
--   skill = cloneDoubleSkill,
-- }
-- preLoadCard(cloneDouble)
-- extension_card:addCards({
--   cloneDouble,
--   cloneDouble:clone(Card.Diamond, 4),
-- })
-- Fk:loadTranslationTable {
--   ["cloneDouble"] = "双持",
--   [":cloneDouble"] = "锦囊牌牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：自己<br /><b>效果</b>：将手牌的伤害牌或能力牌复制1张",
--   ["#clonedouble_skill"] = "将手牌的伤害牌或能力牌复制1张",
-- }
-- --诅咒牌
-- --受伤
-- local hurtStatusSkill = fk.CreateActiveSkill{
--   name = "hurtstatus_skill",
--   prompt = "#hurtstatus_skill",
--   mod_target_filter = Util.TrueFunc,
--   can_use = function(self, player, card)
--     return false
--   end,
--   on_use = function(self, room, cardUseEvent)
--   end,
--   on_effect = function(self, room, effect)
--   end
-- }
-- local hurtStatus = fk.CreateBasicCard{
--   name = "hurtstatus",
--   suit = Card.Spade,
--   number = 1,
--   skill = hurtStatusSkill,
-- }
-- preLoadCard(hurtStatus)
-- extension_card:addCards({
--   hurtStatus,
--   -- hurtStatus:clone(Card.Spade, 4),
--   -- hurtStatus:clone(Card.Spade, 8),
--   -- hurtStatus:clone(Card.Spade, 12),
-- })
-- Fk:loadTranslationTable {
--   ["hurtstatus"] = "受伤",
--   [":hurtstatus"] = "状态牌<br /><b>时机</b>：<br /><b>目标</b>：<br /><b>效果</b>：不能打出此牌",
--   ["#hurtstatus_skill"] = "不能打出此牌",
-- }
--自定义风华绝代卡组

extension_card:addCards{
  Fk:cloneCard("slash", Card.Diamond, 6),
  Fk:cloneCard("slash", Card.Diamond, 7),
  Fk:cloneCard("slash", Card.Diamond, 9),
  Fk:cloneCard("slash", Card.Diamond, 13),
  Fk:cloneCard("slash", Card.Heart, 10),
  Fk:cloneCard("slash", Card.Heart, 10),
  Fk:cloneCard("slash", Card.Heart, 11),
  Fk:cloneCard("slash", Card.Club, 6),
  Fk:cloneCard("slash", Card.Club, 7),
  Fk:cloneCard("slash", Card.Club, 8),
  Fk:cloneCard("slash", Card.Club, 11),
  Fk:cloneCard("slash", Card.Club, 8),
  Fk:cloneCard("slash", Card.Spade, 9),
  Fk:cloneCard("slash", Card.Spade, 9),
  Fk:cloneCard("slash", Card.Spade, 10),
  Fk:cloneCard("slash", Card.Spade, 10),
  Fk:cloneCard("slash", Card.Club, 2),
  Fk:cloneCard("slash", Card.Club, 3),
  Fk:cloneCard("slash", Card.Club, 4),
  Fk:cloneCard("slash", Card.Club, 5),
  Fk:cloneCard("slash", Card.Club, 11),
  Fk:cloneCard("slash", Card.Diamond, 8),
  Fk:cloneCard("thunder__slash", Card.Spade, 4),
  Fk:cloneCard("thunder__slash", Card.Spade, 5),
  Fk:cloneCard("thunder__slash", Card.Spade, 6),
  Fk:cloneCard("thunder__slash", Card.Club, 5),
  Fk:cloneCard("thunder__slash", Card.Club, 6),
  Fk:cloneCard("thunder__slash", Card.Club, 7),
  Fk:cloneCard("thunder__slash", Card.Club, 8),
  Fk:cloneCard("thunder__slash", Card.Club, 9),
  Fk:cloneCard("thunder__slash", Card.Club, 9),
  Fk:cloneCard("thunder__slash", Card.Club, 10),
  Fk:cloneCard("thunder__slash", Card.Club, 10),
  Fk:cloneCard("fire__slash", Card.Heart, 4),
  Fk:cloneCard("fire__slash", Card.Heart, 7),
  Fk:cloneCard("fire__slash", Card.Diamond, 5),
  Fk:cloneCard("fire__slash", Card.Heart, 10),
  Fk:cloneCard("fire__slash", Card.Diamond, 4),
  Fk:cloneCard("fire__slash", Card.Diamond, 10),
  Fk:cloneCard("jink", Card.Diamond, 11),
  Fk:cloneCard("jink", Card.Diamond, 3),
  Fk:cloneCard("jink", Card.Diamond, 5),
  Fk:cloneCard("jink", Card.Diamond, 6),
  Fk:cloneCard("jink", Card.Diamond, 7),
  Fk:cloneCard("jink", Card.Diamond, 8),
  Fk:cloneCard("jink", Card.Diamond, 9),
  Fk:cloneCard("jink", Card.Diamond, 10),
  Fk:cloneCard("jink", Card.Diamond, 11),
  Fk:cloneCard("jink", Card.Heart, 13),
  Fk:cloneCard("jink", Card.Heart, 8),
  Fk:cloneCard("jink", Card.Heart, 9),
  Fk:cloneCard("jink", Card.Heart, 11),
  Fk:cloneCard("jink", Card.Heart, 12),
  Fk:cloneCard("jink", Card.Diamond, 6),
  Fk:cloneCard("jink", Card.Diamond, 7),
  Fk:cloneCard("jink", Card.Diamond, 8),
  Fk:cloneCard("jink", Card.Diamond, 10),
  Fk:cloneCard("jink", Card.Diamond, 11),
  Fk:cloneCard("jink", Card.Heart, 2),
  Fk:cloneCard("jink", Card.Heart, 2),
  Fk:cloneCard("jink", Card.Diamond, 2),
  Fk:cloneCard("jink", Card.Diamond, 2),
  Fk:cloneCard("jink", Card.Diamond, 4),
  Fk:cloneCard("peach", Card.Diamond, 12),
  Fk:cloneCard("peach", Card.Heart, 3),
  Fk:cloneCard("peach", Card.Heart, 4),
  Fk:cloneCard("peach", Card.Heart, 6),
  Fk:cloneCard("peach", Card.Heart, 7),
  Fk:cloneCard("peach", Card.Heart, 8),
  Fk:cloneCard("peach", Card.Heart, 9),
  Fk:cloneCard("peach", Card.Heart, 12),
  Fk:cloneCard("peach", Card.Heart, 5),
  Fk:cloneCard("peach", Card.Heart, 6),
  Fk:cloneCard("peach", Card.Diamond, 2),
  Fk:cloneCard("peach", Card.Diamond, 3),
  Fk:cloneCard("analeptic", Card.Diamond, 9),
  Fk:cloneCard("analeptic", Card.Spade, 3),
  Fk:cloneCard("analeptic", Card.Spade, 9),
  Fk:cloneCard("analeptic", Card.Club, 3),
  Fk:cloneCard("analeptic", Card.Club, 9),

  Fk:cloneCard("crossbow", Card.Spade, 6),
  Fk:cloneCard("double_swords", Card.Diamond, 4),
  Fk:cloneCard("qinggang_sword", Card.Diamond, 10),
  Fk:cloneCard("blade", Card.Heart, 1),
  Fk:cloneCard("spear", Card.Spade, 12),
  Fk:cloneCard("axe", Card.Diamond, 5),
  Fk:cloneCard("kylin_bow", Card.Spade, 10),
  Fk:cloneCard("guding_blade", Card.Heart, 11),
  Fk:cloneCard("chitu", Card.Heart, 8),
  Fk:cloneCard("zixing", Card.Diamond, 13),
  Fk:cloneCard("dayuan", Card.Spade, 13),
  Fk:cloneCard("jueying", Card.Spade, 9),
  Fk:cloneCard("dilu", Card.Club, 2),
  Fk:cloneCard("zhuahuangfeidian", Card.Heart, 12),
  Fk:cloneCard("hualiu", Card.Diamond, 3),

  Fk:cloneCard("snatch", Card.Diamond, 7),
  Fk:cloneCard("snatch", Card.Diamond, 8),
  Fk:cloneCard("snatch", Card.Spade, 9),
  Fk:cloneCard("dismantlement", Card.Heart, 12),
  Fk:cloneCard("dismantlement", Card.Spade, 4),
  Fk:cloneCard("dismantlement", Card.Heart, 2),
  Fk:cloneCard("amazing_grace", Card.Heart, 3),
  Fk:cloneCard("amazing_grace", Card.Heart, 4),
  Fk:cloneCard("duel", Card.Diamond, 1),
  Fk:cloneCard("duel", Card.Spade, 1),
  Fk:cloneCard("duel", Card.Club, 1),
  Fk:cloneCard("savage_assault", Card.Spade, 13),
  Fk:cloneCard("savage_assault", Card.Spade, 7),
  Fk:cloneCard("savage_assault", Card.Club, 7),
  Fk:cloneCard("archery_attack", Card.Heart, 1),
  Fk:cloneCard("lightning", Card.Heart, 12),
  Fk:cloneCard("god_salvation", Card.Heart, 1),
  Fk:cloneCard("nullification", Card.Club, 12),
  Fk:cloneCard("nullification", Card.Club, 13),
  Fk:cloneCard("nullification", Card.Spade, 11),
  -- Fk:cloneCard("nullification", Card.Diamond, 12),
  -- Fk:cloneCard("nullification", Card.Heart, 1),
  -- Fk:cloneCard("nullification", Card.Spade, 13),
  -- Fk:cloneCard("nullification", Card.Heart, 13),
  -- Fk:cloneCard("indulgence", Card.Heart, 6),
  -- Fk:cloneCard("indulgence", Card.Club, 6),
  -- Fk:cloneCard("indulgence", Card.Spade, 6),
  -- Fk:cloneCard("iron_chain", Card.Spade, 11),
  -- Fk:cloneCard("iron_chain", Card.Club, 12),
  -- Fk:cloneCard("iron_chain", Card.Club, 13),
  -- Fk:cloneCard("supply_shortage", Card.Spade, 10),
  -- Fk:cloneCard("supply_shortage", Card.Club, 4),
}

--虎牢关、无尽的试炼模式
--Fk:addGameMode(require "packages/fkpve/hulao_mode")
Fk:addGameMode(require "packages/fkpve/wujinshilian_mode")
Fk:addGameMode(require "packages/fkpve/ZSHH_mode")

-- Fk:addGameMode(require "packages/fkpve/fhjd_mode")

return {extension,
        extension_card
}
